﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Hr.DAL;
using Hr.IBLL;
using Hr.IDAL;
using Hr.Model;
namespace Hr.BLL
{
    public partial class LoginService : BaseService<User_List>, IUser_ListService
    {
        private IUser_ListDAL LoginDAL = Hr.DALContainer.Container.Resolve<IUser_ListDAL>();
        //引入 自己的Dal层
        protected LoginDAL Udl = new LoginDAL();

        /// <summary>
        /// 通过用户名和密码查询用户信息
        /// </summary>
        /// <param name="UserName"></param>
        /// <param name="Password"></param>
        /// <returns></returns>
        //登录
        public User_List Login(string UserName, string Password)
        {
            
            return Udl.GetUser(UserName, Password);
        }
        /// <summary>
        /// 修改用户信息
        /// </summary>
        /// <param name="u"></param>
        public bool UpdateUser(User_List u)
        {

             Udl.UpdateUser(u);
            return Udl.SaveChanges();
        }
        public bool UpdateUserRemark(int UserID, string Remark)
        {

            Udl.UpdateUserRemark(UserID, Remark);
            return Udl.SaveChanges();
        }
        
        public string GetPosition(int pk_Position)
        {
            return Udl.GetPosition(pk_Position);
        }
        public string GetDepartment(int pk_Department)
        {
            return Udl.GetDepartment(pk_Department);
        }
        public override void SetDal()
        {
            Dal = LoginDAL;
        }
    }
}
